{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>

    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/account.css' %}">
    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            background: #ffffff;
        }

        body {
            align-items: center;
            background-image: url('{% static 'images/img.png'%}');
            font-family: 'Arial', sans-serif;

        );
            background-size: cover;
            background-position: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
        }

        .login-container {
            width: 450px;
            height: 600px;
            background-color: rgba(204, 204, 204, 0.92);; /* 容器背景颜色 */
        {#padding: 20px;#} margin: auto;
            border-radius: 8px; /* 圆角边框 */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
            padding: 30px;
            position: absolute;
            left: 1200px;
            top: 160px;


        }

        .left-section {
            width: 1200px; /* 左侧列宽度 */
            background-color: transparent; /* 左侧列背景颜色 */

        }

        .right-section {
            background-color: transparent; /* 右侧列背景颜色 */
            height: 100%;
            justify-content: center; /* 水平居中 */
            align-items: center; /* 垂直居中 */
            display: flex;
            /* 右侧背景颜色 */
            padding: 20px;
        }

        .content-container {
            display: flex;
            flex: 1;
            height: 80%;
        }

        .navbar {
            position: absolute;
            display: flex;
            top: 50px;
            left: 100px;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            padding-top: 0.2rem;

        }

        .title {
            font-family: "Microsoft YaHei", sans-serif; /* 将字体更改为微软雅黑，如果用户没有微软雅黑，则使用 sans-serif 字体 */
            font-weight: bold; /* 加粗字体 */
            color: #000000; /* 设置字体颜色 */


        }

        .form-group label {

            display: inline-block;
            width: 100px; /* 调整标签宽度，根据需要调整 */
            margin-right: 10px; /* 右侧间距，根据需要调整 */
        }

        .btn-login {
            width: 300px; /* 设置宽度，根据需要调整 */
            height: 50px; /* 设置高度，根据需要调整 */
            position: relative;
            left: auto;
        }

        .centered-div {
            background-color: transparent;
            width: auto;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .left-text-lg{
            position: absolute;
            left: 350px ;
            top: 400px;
            font-size: 80px;
            color: white;
            font-family: "Microsoft Himalaya";
        }

    </style>

</head>
<body>
<nav class="navbar navbar-expand-lg">
    <!-- logo -->
    <a class="navbar-brand" href="/register/">
        <img src="{% static 'images/logo.png' %}" alt="header-Logo" height="200px"></a>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText">
        <span class="icon-bar"><i class="fa fa-bars fa-2x"></i></span>
    </button>

</nav>
<div class="content-container">
    <div class="left-section">
        <p class="left-text-lg">开始你的探索</p>
    </div>
    <div class="right-section">
        <div class="login-container">
            <h2 class="title ">用户登录</h2>
            <p>没有账号？<a href="/register/">立即注册</a></p>
            <p><br></p>
            <form method="post" novalidate class="login-form">
                {% csrf_token %}
                <div class="form-group">
                    <label for="id_password"><strong>用户名</strong></label>
                    {{ form.username }}
                    <br><br>
                    <span class="error">{{ form.username.errors.0 }}</span>
                </div>
                <div class="form-group">
                    <label for="id_password"><strong>密码</strong></label>
                    {{ form.password }}
                    <br><br>
                    <span class="error">{{ form.password.errors.0 }}</span>

                </div>
                <div class="form-group">
                    <label for="id_code"><strong>图片验证码</strong></label>
                    <div class="row">
                        <div class="col-xs-7">
                            {{ form.code }}
                            <span class="error">{{ form.code.errors.0 }}</span>
                            <br>
                        </div>
                        <div class="col-xs-5">
                            <img id="image_code" src="/image/code/" alt="验证码" class="captcha-image">
                            <button type="button" class="btn btn-link btn-refresh btn-primary "
                                    onclick="refreshCaptcha()">刷新
                            </button>
                        </div>
                    </div>
                </div>
                <br>
                <div class="container centered-div">
                    <input type="submit" value="登录" class="btn btn-primary btn-login ">

                </div>
            </form>

        </div>
    </div>
</div>
</body>
</html>

